package com.gowants.pems.service;

import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gowants.pems.util.JSONList;
import com.gowants.pems.util.JSONMap;
import com.gowants.pems.util.RedisUtils;

@Service(value = "RedisService")
public class RedisService {
	@Autowired
	private RedisUtils redisUtils;
	
	public JSONList Keys()
	{
		JSONList response = new JSONList();
		String key = "*";
		Set<String> keys=redisUtils.keys(key);
		for(String key0:keys) {
	    	String spObject = redisUtils.getStringRedis(key0);
	    	JSONMap responseMap = new JSONMap();
	    	responseMap.put(key0, spObject);
	    	response.add(responseMap);
		}
		return response;
	}
}
